<template>
    <div>
        <avue-crud style="margin-top: -2%" ref="crudorderLog"
                   :data="data"
                   :option="option"
                   :page.sync="page"
                   @on-load="onLoad"
                   @refresh-change="onLoad">
        </avue-crud>
    </div>
</template>

<script>

    export default {
        data() {
            return {
                data: [],
                option: {},
                page: this.website.pageParams,
            }
        },
        props: {
            uri: {},
            rowData: {},
        },
        computed: {},
        mounted() {
            this.option = JSON.parse(JSON.stringify(this.website.optionConfig));
            this.option.refreshBtn = false;       // 是否需要刷新按钮
            this.option.menu = false;       // 是否需要刷新按钮
            this.option.column = [
                {
                    label: '操作类型 ',
                    prop: 'operationType',
                    type: 'select',
                    search: false,
                    searchSpan: 5,
                    overHidden: true,
                    dicData: this.dict.get('OPERATION_TYPE'),
                },
                {
                    label: '操作前状态',
                    prop: 'frontState',
                    search: false,
                    searchSpan: 5,
                    overHidden: true,
                    dicData: this.dict.get('ORDER_STATE'),
                },
                {
                    label: '操作后状态',
                    prop: 'afterState',
                    search: false,
                    searchSpan: 5,
                    overHidden: true,
                    dicData: this.dict.get('ORDER_STATE'),
                },
                {
                    label: '备注信息',
                    prop: 'remarks',
                    search: false,
                    searchSpan: 5,
                    overHidden: true,
                },
                {
                    label: '操作人',
                    prop: 'operationFullName',
                    search: false,
                    searchSpan: 5,
                    overHidden: true,
                }, {
                    label: '操作时间',
                    prop: 'createTime',
                    search: false,
                    searchSpan: 5,
                    overHidden: true,
                },
            ]
        },
        created() {
        },
        methods: {
            onLoad() {
                this.crud.get(this.uri.orderLogInfoList, {orderId: this.rowData.id}).then((res) => {
                    this.data = res.data.data.records;
                })
            }
        }
    }
</script>

